Add test demonstrating AST traversal and type checking#61
Merged
alexcrocha merged 1 commit into11-20-handle_rbskeyword_typesfrom Nov 24, 2025
Merged
Conversation
Adds test_parse_integer() which parses an integer literal type alias and traverses the AST (TypeAlias -> LiteralType -> Integer) using pattern matching to verify node types and extract values. This validates that the generated node wrappers enable idiomatic Rust AST traversal with proper type safety. Also adds Debug derives and fixes memory management by returning SignatureNode instead of raw pointer, with Drop impl to free parser.
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Merged
vinistock
approved these changes
Nov 21, 2025
| impl Drop for SignatureNode { | ||
| fn drop(&mut self) { | ||
| unsafe { | ||
| rbs_parser_free(self.parser); |
Member
There was a problem hiding this comment.
@amomchilov one doubt we had that I wanted to double check with you: does this also free all of the nodes thanks to the arena allocator? Or do we also need to free the nodes?
Author
There was a problem hiding this comment.
We'll fix it forward if necessary. Merging as is for now.
c2d9326
into
11-20-handle_rbskeyword_types
16 of 27 checks passed
alexcrocha
added a commit
that referenced
this pull request
Nov 25, 2025
Adds `test_parse_integer()` which parses an integer literal type alias and traverses the AST (`TypeAlias` -> `LiteralType` -> `Integer`) using pattern matching to verify node types and extract values. This validates that the generated node wrappers enable AST traversal in pure Rust with proper type safety. Also adds `Debug` derives and refactors memory management by returning `SignatureNode` instead of raw pointer, with `Drop` impl to free parser.
alexcrocha
added a commit
that referenced
this pull request
Jan 13, 2026
Adds `test_parse_integer()` which parses an integer literal type alias and traverses the AST (`TypeAlias` -> `LiteralType` -> `Integer`) using pattern matching to verify node types and extract values. This validates that the generated node wrappers enable AST traversal in pure Rust with proper type safety. Also adds `Debug` derives and refactors memory management by returning `SignatureNode` instead of raw pointer, with `Drop` impl to free parser.
alexcrocha
added a commit
that referenced
this pull request
Jan 13, 2026
Adds `test_parse_integer()` which parses an integer literal type alias and traverses the AST (`TypeAlias` -> `LiteralType` -> `Integer`) using pattern matching to verify node types and extract values. This validates that the generated node wrappers enable AST traversal in pure Rust with proper type safety. Also adds `Debug` derives and refactors memory management by returning `SignatureNode` instead of raw pointer, with `Drop` impl to free parser.
alexcrocha
added a commit
that referenced
this pull request
Jan 14, 2026
Adds `test_parse_integer()` which parses an integer literal type alias and traverses the AST (`TypeAlias` -> `LiteralType` -> `Integer`) using pattern matching to verify node types and extract values. This validates that the generated node wrappers enable AST traversal in pure Rust with proper type safety. Also adds `Debug` derives and refactors memory management by returning `SignatureNode` instead of raw pointer, with `Drop` impl to free parser.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Adds
test_parse_integer()which parses an integer literal type alias and traverses the AST (TypeAlias->LiteralType->Integer) using pattern matching to verify node types and extract values.This validates that the generated node wrappers enable AST traversal in pure Rust with proper type safety.
Also adds
Debugderives and refactors memory management by returningSignatureNodeinstead of raw pointer, withDropimpl to free parser.